<template>
	<div>
		<HomeHeader></HomeHeader>
		<HomeLeft :cur="2"></HomeLeft>
		<div id="main">
			<div id="web_con">
				<div class="web_wp">
					<div class="web_location">
						<div class="here_area">
							<strong>当前位置：</strong>会员管理&nbsp;&nbsp;»&nbsp;&nbsp;预计收益
						</div>
						<div class="here_btn">
							<a href="javascript:history.back()" class="web_btn btn_add"><em
									class="iconfont icon-shdcfanhui"></em>返回</a>
						</div>
					</div>
					<div class="filter clearfix">
						<div class="aa">
							<div class="item">
								会员姓名：<b style="font-size: 20px;color: #1772f6;">{{name}}</b>
							</div>
							<div class="item">
								预计收益汇总：<b style="font-size: 20px;color: #1772f6;">{{sum}}</b>
							</div>
						</div>
						<div class="bb">
							
							<a href="javascript:;" class="web_btn btn_refresh" @click="Refresh()"><em
									class="iconfont icon-shdcshuaxin"></em>刷新</a>
						</div>
					</div>

					<div class="web_table">
						<table>
							<tr>
								<!-- <th class="tac" style="width: 60px;">选择</th> -->
								<th class="tac">交易编号</th>
								<th class="tac">用户名称</th>
								<th class="tac">商户号</th>
								<th class="tac">存入金额</th>
								<th class="tac">支付方式</th>
								<th class="tac">年化收益率</th>
								<th class="tac">预计收益</th>
								<th class="tac">赠送积分</th>
								<th class="tac">生效日期</th>
								<th class="tac">到期日期</th>
								<th class="tac">状态</th>
							</tr>
							<tr v-for="(item,i) in listinfo.data" :key="i">
								<td class="tac">{{item.payno}}</td>
								<td class="tac">{{item.user.nickname}}</td>
								<td class="tac">{{item.user.merchantno}}</td>
								<td class="tac">{{item.pay_fee}}</td>
								<td class="tac">
									<span v-if="item.pay_type=='offline'">线下支付</span>
									<span v-else-if="item.pay_type=='wechat'">微信支付</span>
									<span v-else>{{item.pay_type}}</span>
								</td>
								<td class="tac">
									<span>{{item.current.balance/item.pay_fee*100}}%</span>
								</td>
								<td class="tac">
									<span v-if="item.current">{{item.current.balance}}</span>
									<span v-else>-</span>
								</td>
								<td class="tac">{{item.current.integral}}</td>
								<td class="tac">
									<span v-if="item.status==30">{{item.current.start_at}}</span>
									<span v-else>---</span>
								</td>
								<td class="tac">
									<span v-if="item.status==30">{{item.current.end_at}}</span>
									<span v-else>---</span>
								</td>
								<td class="tac">
									<span v-if="item.status==10&&item.pay_type=='offline'">线下待付款</span>
									<span v-if="item.status==10&&item.pay_type=='wechat'">支付失败</span>
									<span v-if="item.status==20&&item.pay_type=='offline'">待确认</span>
									<span
										v-if="item.status==30">进行中（{{item.current.action=='renew'?'到期续签':'到期赎回'}}）</span>
								</td>
							</tr>
							<!-- <tr>
								<td class="tac">提现（扣除手续费3%）</td>
								<td class="tac">-20000</td>
								<td class="tac">2024-05-27 10:00:00</td>	
							</tr> -->
						</table>
					</div>
					<div class="web_page">
						<el-pagination background @current-change="ChengPage" :current-page="page" :page-size="10"
							layout="total,prev, pager,next" :total="listinfo.total">
						</el-pagination>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import HomeHeader from '../components/Header.vue'
	import HomeLeft from '../components/Left.vue'
	export default {
		components: {
			HomeHeader,
			HomeLeft,

		},
		data() {
			return {
				page: 1,
				listinfo: [],
				keywords: '',
				zong:0,
				sum:0,
			}
		},
		onLoad(e) {
			this.name = e.name;
			this.sum = e.money;
			this.GetList(e.id)
			
		},
		methods: {
			Refresh: function() {
				this.Seach();
			},
			Seach: function() {
				this.page = 1;
				this.GetList();
			},
			GetList: function(id) {
				let that = this;
				uni.showLoading({
					title: '加载中...',
					mask: true
				});
				let _data = {
					status: 30,
					keywords: that.name,
					page: that.page,
					per_page: 10,
				};
				that.common.http('GET', 'pay', _data, function(res) {
					uni.hideLoading();
					console.log(res.data.data)
					that.listinfo = res.data
				});
			},
			LookTest: function(id) {
				uni.navigateTo({
					url: '/pages/member/info?id=' + id
				})
			},
		}
	}
</script>

<style>


</style>